package ebcs.scan.controller.capacityCtr;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import jplat.tools.string.DateUtil;

/**
 * 节假日工作时间处理 假日只处理今年、去年的 1.1、5.1、10.1，和周末
 */
public class HolidayUtil {

	public static void main(String[] args) {
		Calendar c = Calendar.getInstance();
		c.set(2017, 0, 1);
		while (2020 >= c.get(Calendar.YEAR)) {	
			if (c.get(Calendar.DAY_OF_WEEK) == 1 || c.get(Calendar.DAY_OF_WEEK) == 7) {
				Date date = Calendar.getInstance().getTime();
				String result = "";
				try {
					if (date != null) {
						java.text.DateFormat df = new java.text.SimpleDateFormat("yyyyMMdd");
						result = df.format(date);
					}
				} catch (Exception e) {
				}
 				String dataStr = DateUtil.format(c.get(Calendar.YEAR) + "-" + (c.get(Calendar.MONTH) + 1) + "-" + c.get(Calendar.DATE)
				 , "yyyy-m-d", "yyyyMMdd") ;
 				System.out.println(dataStr);
				
			}
			c.add(Calendar.DATE, 1);
		}
	}

	// 打印
	public static void printf(Calendar calendar) {
		System.out.println(calendar.get(Calendar.YEAR) + "-" + (1 + calendar.get(Calendar.MONTH)) + "-"
				+ calendar.get(Calendar.DATE));

	}
}